#ifndef MOTOR_H
#define MOTOR_H

#include "send.h"

using namespace std;
//! An object to control a robot's motors
class Motor {
    private:
	//! debug mode is 1 will store last commanded speed    
    static const unsigned char REPORT_SPEED = 0;
	//! if REPORT_SPEED is 1 store last commanded speed in these variables
    unsigned char lastRightSpeed,
                  lastLeftSpeed;
	//! boolean value of REPORT_SPEED
    bool reportSpeed;
         
	public:
	//! Motor constructor sets both motors to stop
    Motor();
	//! tells both motors to go
	void go();
	//! tells both motors to stop
	void stop();
	//! tells both motors to go in reverse
	void reverse();
	//! tells both motores to go at an offset from the neutral speed
	void goOffset(unsigned char offset);
	//! tells both motores to go in reverse at an offset from the neutral speed
	void reverseOffset(unsigned char offset);
	//! tells the robot to spin right
	void spinRight();
	//! tells the robot to spin left
	void spinLeft();
	//! tells the robot to turn right
	void turnRight();
	//! tells the robot to turn left
	void turnLeft();
	//! tells the robot's right wheel to go
	void rightWheelGo();
	//! tells the robot's right wheel to stop
	void rightWheelStop();
	//! tells the robot's right wheel to go in reverse
	void rightWheelReverse();
	//! tells the robot's right wheel to go at an offset from the neutral speed
	void rightWheelGoOffset(unsigned char offset);
	//! tells the robot's right wheel to go in reverse at an offset from the neutral speed
	void rightWheelReverseOffset(unsigned char offset);
	//! tells the robot's left wheel to go
	void leftWheelGo();
	//! tells the robot's left wheel to stop
	void leftWheelStop();
	//! tells the robot's left wheel to go in reverse
	void leftWheelReverse();
	//! tells the robot's left wheel to go at an offset from the neutral speed
	void leftWheelGoOffset(unsigned char offset);
	//! tells the robot's left wheel to go in reverse at an offset from the neutral speed
	void leftWheelReverseOffset(unsigned char offset);
	//! tells the robot's right wheel to go at a variable speed offset
	void rightWheelVar(unsigned char speed);
	//! tells the robot's left wheel to go at a variable speed offset
	void leftWheelVar(unsigned char speed);
	//! sets reportSpeed
    void setReportSpeed(bool rs);
	//! \return lastRightSpeed
    unsigned char getLastLeftSpeed();
	//! \return lastLeftSpeed
    unsigned char getLastRightSpeed();
};
#endif
